package org.jsbd.boss.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.jsbd.boss.common.DataGridModel;
import org.jsbd.boss.dao.IIpreqImsiDAO;
import org.jsbd.boss.domian.statistics.IpreqImsiVO;
import org.springframework.stereotype.Repository;

@Repository("ipreqImsiDAO")
public class IIpreqImsiDAOImpl extends CrackStatisticsBaseDao implements IIpreqImsiDAO {

	@Override
	public Map<String, Object> getIreqImsiData(DataGridModel page, String startDate, String endDate) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("page", page);
		params.put("startDate", startDate);
		params.put("endDate", endDate);

		Map<String, Object> results = new HashMap<String, Object>();
		results.put("rows", super.queryForList("qy_channel_ipreq_imsi_statistics.SELECT_LIST", params));
		List<String> strs = super.queryForList("qy_channel_ipreq_imsi_statistics.SELECT_COUNT", params);
		results.put("total", strs.size());
		return results;

	}

	@Override
	public List<IpreqImsiVO> getIreqImsiDetail(String day) {
		return super.queryForList("qy_channel_ipreq_imsi_statistics.SELECT_IREQ_IMSI_DETAIL", day);
	}

	@Override
	public Map<String, Object> getClientInfoData(DataGridModel page, String startDate, String endDate) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("page", page);
		params.put("startDate", startDate);
		params.put("endDate", endDate);

		Map<String, Object> results = new HashMap<String, Object>();
		results.put("rows", super.queryForList("qy_channel_ipreq_imsi_statistics.SELECT_CLIENT_INFO_LIST", params));
		List<String> strs = super.queryForList("qy_channel_ipreq_imsi_statistics.SELECT_CLIENT_INFO_COUNT", params);
		results.put("total", strs.size());
		return results;
	}

	@Override
	public List<IpreqImsiVO> getClientInfoDetail(String day) {
		return super.queryForList("qy_channel_ipreq_imsi_statistics.SELECT_CLIENT_INFO_DETAIL", day);
	}

}
